package javabean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.Date;
import java.util.Objects;

/**
 * packageName com.mt.bms.javabean
 *
 * @author Administrator
 * @version 1.0
 * @className detail (此处以class为例)
 * @date 2024/8/2
 * @description
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Detail {
    private Integer id;//'唯一主键',
    private String myUsername;//'交易账号',
    private String toUsername;//'目标账号',
    private Double money;//'交易金额',
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;//'交易时间',

    public Detail() {
    }

    public Detail(String myUsername, String toUsername, Double money) {
        this.myUsername = myUsername;
        this.toUsername = toUsername;
        this.money = money;
    }

    public Detail(Integer id, String myUsername, String toUsername, Double money, Date time) {
        this.id = id;
        this.myUsername = myUsername;
        this.toUsername = toUsername;
        this.money = money;
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Detail detail = (Detail) o;
        return Objects.equals(id, detail.id) && Objects.equals(myUsername, detail.myUsername) && Objects.equals(toUsername, detail.toUsername) && Objects.equals(money, detail.money) && Objects.equals(time, detail.time);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, myUsername, toUsername, money, time);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMyUsername() {
        return myUsername;
    }

    public void setMyUsername(String myUsername) {
        this.myUsername = myUsername;
    }

    public String getToUsername() {
        return toUsername;
    }

    public void setToUsername(String toUsername) {
        this.toUsername = toUsername;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "Detail{" +
                "id=" + id +
                ", myUsername='" + myUsername + '\'' +
                ", toUsername='" + toUsername + '\'' +
                ", money=" + money +
                ", time=" + time +
                '}';
    }

}